package com.hualan.sfzyproject.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hualan.sfzyproject.domain.CharityActivity;
import com.hualan.sfzyproject.domain.Consultants;
import com.hualan.sfzyproject.mapper.CharityActivityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CharityActivityService {
    @Autowired
    public CharityActivityMapper charityActivityMapper;

    public PageInfo<CharityActivity> listAll(int page, int pageSize) {
        PageHelper.startPage(page, pageSize);
        List<CharityActivity> list = charityActivityMapper.listAll();
        return new PageInfo<>(list);
    }
    public List<Consultants> listAllConsultants() {
        List<Consultants> list = charityActivityMapper.listAllConsultants();
        return list;
    }
    //根据标题模糊查询
    public List<CharityActivity> selectByTitle(String title){
        return charityActivityMapper.selectByTitle(title);
    }
    public List<CharityActivity> selectById(Integer id){
        return charityActivityMapper.selectByConsultantsId(id);
    }
}
